package com.kaluli.project.repository.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.kaluli.project.domain.entity.KllOrderSynApi;
import com.kaluli.project.domain.entity.KllProduct;
import com.kaluli.project.domain.entity.KllProductVo;
import com.kaluli.project.domain.repository.KllProSkuRepository;
import com.kaluli.project.domain.repository.KllProductRepository;
import com.kaluli.system.repository.AbstractRepositorySupport;

@Repository
public class KllProSkuRepositoryImpl extends AbstractRepositorySupport<KllProduct> implements KllProSkuRepository{

	@Override
	protected Class<KllProduct> getEntityClass() {
		// TODO Auto-generated method stub
		return KllProduct.class;
	}

	
	
	public KllProduct findItems(Long id){
		StringBuffer hql=new StringBuffer(" from KllProduct k where k.id=:itemId");
		Map<String,Object> params=new HashMap<String, Object>();
		params.put("itemId", id);
		List<KllProduct> list =  this.findHqlForMap(hql.toString(), params);
		KllProduct kllProduct = null;
		if(list!=null&list.size()>0){
			kllProduct = list.get(0);
		}
		return kllProduct;
	}

	
	

}
